home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / err_func.arc / READ.ME < prev    next >
Text File  |  1990-09-16  |  4KB  |  83 lines

  1.  
  2.  
  3.                                 ERR_FUNC
  4.  
  5.  
  6.          A Unit for producing Meaningfull Run time error information.
  7.  
  8.          by: Richard A. Morris   Fido (3:640/378) Mail only
  9.                                  Ph: AUST UTZ+10 (07) 878 1194
  10.                                  P.O. Box 544, INDOOROOPILLY  QLD  4068, AUSTRALIA
  11.  
  12.          Released into the Public Domain and Simultaneously entered into the
  13.          "Great PASCAL Echo" Contest, and the Programmers distribution network.
  14.  
  15.          For anyone who tries to manage a large project, Beta Testers
  16.          are a necessary evil, as it is ALWAYS impossible for a programmer
  17.          to test his brain child thoroughly :-).  The problem with
  18.          Beta Testing is that if you don't keep old versions of
  19.          Source code (Or Heavens forbid release source to your betas),
  20.          When a beta Tester rings in a run-time error, the information
  21.          is meaningless, especially if you have made alterations to code
  22.          EVEN if it was not in the unit at error. eg:
  23.  
  24.          BETA : Um, Richard we've got a Run-Time error number 5 in 0000:006D
  25.  
  26.          RICHARD: HUH!!!
  27.  
  28.          BETA : Happened after we did a Green thingy.
  29.  
  30.          RICHARD: O.K. I'll Look into it <FX:CLICK>  AAARRRRRRGGGGGHHH!!!!
  31.          <FX: Running of Compile FIND on 0000:006D> Result: Can't find line
  32.          number.....  ARRRRRGHHHHHH!!!!! But I only made one change!!!!
  33.  
  34.          Well this may help, As you may know the MAP file generated
  35.          with a Fully debuggable (As beta should be) code, contains
  36.          enough information to find out EXACTLY (Well to the nearest
  37.          line, picky) Where the error occured, in which unit, etc etc.
  38.          Let's have another look at that scenario.
  39.  
  40.          BETA : Richard, Looks like we've got a File Not found error
  41.                 in line 23 of TEST_ERROR.
  42.          RICHARD: O.K. It's fixed!
  43.  
  44.          How do I get this peace of mind, read on!
  45.  
  46.          Simply include this unit in you main program's USES clause
  47.          {Either the first unit or in the case of overlays after
  48.          the OVERLAY unit and your Pre-emptive Overlay loader unit}
  49.          Simply said the unit will assign an error handler onto the
  50.          Run time error queue, and on notice of a Run Time error will
  51.          activate the routine Error_Message.  This routine will firstly
  52.          give a meaningfull error message, showing the standard turbo
  53.          IDE error message, then if this was a DOS error (Good chance),
  54.          It'll find out where and what to do about it (This is MsDos
  55.          ver 3+ only, sorry), then will do a trace into the stack to
  56.          Show How it got to where it got, then annotate each location
  57.          with a Line number (If Line number info was compilled for that
  58.          unit), and the unit.  To get it to do this for Betas, put
  59.          the MAP file created when you compiled the program, into the
  60.          Path of the main executable (Oh did I mention thanks to the
  61.          Latest STAKDUMP dated 18/9/89, it happilly traverses overlayed
  62.          code).  Try TEST_ERR.EXE and see it for yourself.
  63.  
  64.          A couple of Caveats: Use Dos version 3 or greater for extended
  65.                               errors.
  66.  
  67.                               Why didn't I look up the source to Display
  68.                               the actual source line.....What you give
  69.                               source to betas.
  70.  
  71.                               It does get upset sometimes under some
  72.                               stack overflow errors, I haven't aborted
  73.                               on a stack error as it is infrequent, but
  74.                               feel free to change it at will.
  75.  
  76.                               It has only been tested with Turbo v5.5
  77.                               Please let me know by netmail if you get it
  78.                               working on any other version.
  79.  
  80. Rgds,
  81.  
  82. R.A.M.
  83.